MyFlattenFunction
To save a job object when a user saves a printable document, provide a pointer to an application-supplied flattening function in theGXFlattenJob
function. The application-supplied function must match the following declaration. For example, this is how you should declare the function if you were to name itMyFlattenFunction
:
OSErr MyFlattenFunction (long size, void *data, void *refCon);
size
- The size of the segment (in bytes) to write.
data
- A pointer to job object data to flatten.
refCon
- A pointer to a reference constant for application-specific information.
- function result
- An error code of type
OSErr
.DESCRIPTION
When you use theGXFlattenJob
function, QuickDraw GX calls your flattening function multiple times as it flattens job object data to disk. Each time it calls your function, the function should write the next segment of the job object until the entire job object is saved. You can use therefCon
parameter to hold the file reference number of the file containing the data to flatten. You can return anyOSErr
value.SEE ALSO
Listing 2-8 on page 2-28 shows how to use a flattening function.The
GXFlattenJob
function is described on page 2-57.To retrieve a job object that has been flattened, see the next section.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help